export const useContent = () => {
    const open = ref(["material"]);
    const active = ref(1);
    const navList = reactive([
        {
            label: "素材管理",
            value: "material",
            icon: _oss_ + "images/admin/material-store/icon-material.png",
            children: [
                {
                    label: "我的素材",
                    value: 1,
                },
            ],
        },
    ]);

    const onTreeClick = (value) => {
        if (open.value.includes(value)) {
            open.value = open.value.filter((item) => item !== value);
        } else {
            open.value.push(value);
        }
    };

    const onTreeSubClick = (value) => {
        active.value = value;
    };

    return {
        open,
        active,
        navList,
        onTreeClick,
        onTreeSubClick,
    };
};
